home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS065.dsk
/
BUDGET PLOT.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
4KB
|
116 lines
0 HIMEM: 38400
10 LOMEM: 25000
20 ADDRS = PEEK(115) + PEEK(116) *256
30 PRINT CHR$(4);"BLOAD ALPHA#,A";ADDRS -529
40 A2 = ADDRS -529: POKE 115,A2 - INT(A2/256) *256: POKE 116, INT(A2/256)
50 POKE 232, PEEK(115): POKE 233, PEEK(116)
60 PRINT FRE(0)
70 D$ = CHR$(4):N$ = ""
80 M1 = 0:M2 = 0
90 DIM BU(30,13,2),S(30,15),R(13,2)
100 M1 = PEEK(107) +256 * PEEK(108)
110 M2 = PEEK(109) +256 * PEEK(110)
120 DIM B$(30),MN$(13)
130 TEXT : HOME : PRINT "BUDGET PLOT": INPUT "BUDGET DATA FILE NAME? ";N$
140 PRINT D$;"BLOAD";N$;",A";M1
150 REM
160 INPUT "STRING FILE NAME? ";N$
170 PRINT D$"OPEN";N$: PRINT D$;"READ";N$
180 FOR I = 1 TO 30: INPUT B$(I): NEXT
190 FOR I = 1 TO 13: INPUT MN$(I): NEXT
200 PRINT D$"CLOSE";N$
210 TEXT : HOME : VTAB (20): HTAB (1)
220 INPUT " WHITE BACKGROUND? (YES OR NO) ";Y$
230 REM
240 DIM RT(12)
250 FOR J = 1 TO 30
260 GOSUB 510
270 Y = 180:DY = 0:X = 0:DX = 7:S$ = B$(J): GOSUB 790
280 FOR K = 1 TO 2
290 RT = 0: HCOLOR= 2 +(K = 2) *4: HPLOT XO,YS:XP = 0:YP = YS
300 FOR I = 1 TO 12
310 GOSUB 460: IF K = 1 THEN 330
320 HCOLOR= 1 +(RT < = RT(I)) *5: HPLOT XP +XO,YP
330 XP = I *XINC:YP = YT
340 IF YP >YS THEN YP = YS
350 IF YP <0 THEN YP = 0
360 HPLOT TO XP +XO,YP
370 NEXT
380 HPLOT XO,YS
390 NEXT
400 S$ = "ANNUAL BUDGET " + STR$( INT(BU(J,13,1)))
410 X = 279 - LEN(S$) *7:DX = 7:Y = YS -100 *YINC -4:DY = 0: HCOLOR= 3 *(Y$ = "NO"): GOSUB 790
420 S$ = "PLOT CATEGORY CR FOR NEXT":X = XS:DX = 7:Y = 190:DY = 0: GOSUB 790
430 INPUT N$: IF LEN(N$) >0 THEN J = VAL(N$) -1
440 NEXT J
450 GOSUB 640: GOTO 250
460 REM
470 RT = RT +BU(J,I,K)
480 IF K = 1 THEN RT(I) = RT
490 IF BU(J,13,1) = 0 THEN YT = 0: RETURN
500 YT = YS -RT/BU(J,13,1) *YINC *100: RETURN
510 HGR2
520 IF Y$ = "NO" THEN 540
530 HCOLOR= 7: FOR Y = 0 TO 190 STEP 2: HPLOT 0,Y TO 279,Y TO 279,Y +1 TO 0,Y +1: NEXT
540 HCOLOR= 0 +3 *(Y$ = "NO")
550 XO = 35:XINC = 20
560 YINC = 150/200:YS = 160
570 FOR Y = YS -150 TO YS STEP 15: HPLOT XO +1,Y TO XO -3,Y: NEXT
580 HPLOT XO +1,YS -100 *YINC TO XO +241,YS -100 *YINC
590 FOR X = 1 +XO TO XO +241 STEP 20: HPLOT X,YS0 TO X,YS +5 TO X +1,YS +5 TO X +1,YS: NEXT
600 HPLOT XO,YS -150 TO XO,YS TO XO +1,YS TO XO +1,YS -150 TO XO +1,YS TO XO +240,YS
610 HPLOT TO XO +240,YS +1 TO XO +1,YS +1
620 GOSUB 940
630 RETURN
640 REM PLOT RATIOS
650 GOSUB 510:Y = 180:DY = 0:X = 0:DX = 7:S$ = "EXPENSE TO INCOME": GOSUB 790:Y = 60:X = 90:S$ = "IN DEBT": GOSUB 790:Y = 115:X = 90:S$ = "SOLVENT": GOSUB 790
660 FOR K = 1 TO 2
670 HCOLOR= 2 +(K = 2) *4
680 HPLOT XO,YS:XP = 0:YP = YS
690 FOR I = 1 TO 12
700 IF K = 1 THEN 740
710 IF R(I,K) >R(I,1) THEN HCOLOR= 1
720 IF R(I,K) < = R(I,1) THEN HCOLOR= 6
730 HPLOT XP +XO,YP
740 YP = YS -R(I,K) *YINC *100
750 XP = I *XINC
760 XP = INT(XP/2) *2 +K -1
770 HPLOT TO XP +XO,YP
780 NEXT : NEXT : INPUT "HIT RETURN TO CONTINUE ";N$: RETURN
790 REM
800 REM STRING PLOTTER
810 REM INPUT STRING S$
820 S3% = LEN(S$): IF S3% *DX >279 THEN S3% = 279/DX
830 FOR I9 = 1 TO S3%
840 S1$ = MID$ (S$,I9,1):S1% = ASC(S1$)
850 IF S1% <65 OR S1% >90 THEN 870
860 S2% = S1% -65 +12: GOTO 910
870 IF S1% <48 OR S1% >57 THEN 890
880 S2% = S1% -48 +1: GOTO 910
890 IF S1% < >46 THEN 920
900 S2% = 11
910 DRAW S2% AT X,Y
920 X = X +DX:Y = Y +DY: NEXT
930 RETURN
940 REM
950 REM ANNOTATE AXES
960 REM
970 SCALE= 1: ROT= 0
980 MN$ = "JFMAMJJASOND"
990 X = XO +6:DX = 20:Y = YS +9:DY = 0
1000 FOR MN = 1 TO 12
1010 S$ = MID$ (MN$,MN,1): GOSUB 790
1020 NEXT
1030 Y = YS +3:DY = 0
1040 FOR P = 0 TO 200 STEP 20
1050 S$ = STR$(P):X = XO - LEN(S$) *6 -4:DX = 6: GOSUB 790
1060 Y = Y -15
1070 NEXT
1080 X = XO -27:DX = 0:Y = YS -10:DY = -6
1090 S$ = "PERCENT TOTAL BUDGET": ROT= 48
1100 GOSUB 790
1110 ROT= 0
1120 RETURN
63000 REM LOGAN R. ZINTSMASTER 12/26/80
63010 REM PERMISSION IS GRANTED TO REPRODUCE THIS PROGRAM FOR USE BY APPLE COMPUTER USER GROUPS
63020 REM ALL COMMERCIAL RIGHTS RESERVED